// hyb_yl/mycenter/pages/Organ/Organ.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    order3: [{
        "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/organ1.png?sign=fe50ccd4bd2584609c3024aedb4ca04f&t=1592043301',
        'title': '管理入口',
        'url': '/hyb_yl/mysubpages/pages/capitacenter/capitacenter'
      },
      {
        "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/organ2.png?sign=0c070da8d3600398518a603223ede780&t=1592043310',
        'title': '专家管理',
        'url': '/hyb_yl/mycenter/pages/expertAdmin/expertAdmin'
      },
      {
        "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/organ3.png?sign=46d13f02541fcc145e8c9588a46b4c0f&t=1592043320',
        'title': '账户设置',
        'url': ''
      },
      {
        "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/organ4.png?sign=b94ea5e671df543827ef25862dae78a0&t=1592043329',
        'title': '修改资料',
        'url': '/hyb_yl/mycenter/pages/organApply/organApply'
      },
    ],
    ispopup: false
  },
  zsservice: function (e) {
    var that = this
    const url = e.currentTarget.dataset.url;
    const index = e.currentTarget.dataset.index;
    var hid = that.data.hid;
    if (index == 0) {
      this.setData({
        ispopup: true
      })
    } else {
      wx.navigateTo({
        url: url + '?hid=' + hid
      })
    }

  },
  closebind: function () {
    this.setData({
      ispopup: false
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    this.getjigouif()
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  //查询我是否是机构
  getjigouif() {
    var that = this
    app.util.request({
      url: "entry/wxapp/regin.jigouif",
      data: {
        openid: wx.getStorageSync('openid')
      },
      success: function (resing) {
        var hid = resing.data.hid
        app.util.request({
          'url': 'entry/wxapp/team.getlistallzhuanjia',
          data: {
            hid: hid,
          },
          success: function (res) {
            console.log(res)
            that.setData({
              zhuancout: res.data.length
            })
          }
        })
        that.setData({
          state: resing.data.state,
          detail: resing.data,
          hid: resing.data.hid
        })
      }
    })
  },
})